<html>
<head><meta charset="utf-8"><title>Enabling debug logs in compiletest? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html">Enabling debug logs in compiletest?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="213866431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213866431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213866431">(Oct 20 2020 at 01:20)</a>:</h4>
<p>I tried <code>RUST_LOG=debug ./x.py test ...</code> and logging with <code>println</code> but none of these worked. How do I see <code>debug!</code> lines in compiletest?</p>



<a name="213867287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213867287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213867287">(Oct 20 2020 at 01:38)</a>:</h4>
<p><span class="user-mention" data-user-id="119169">@osa1</span> <code>RUSTC_LOG=debug</code></p>



<a name="213867294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213867294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213867294">(Oct 20 2020 at 01:39)</a>:</h4>
<p>and you need debug-logging = true in config.toml</p>



<a name="213867414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213867414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213867414">(Oct 20 2020 at 01:41)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/compiler-debugging.html?highlight=log#getting-logging-output">https://rustc-dev-guide.rust-lang.org/compiler-debugging.html?highlight=log#getting-logging-output</a></p>



<a name="213870299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213870299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213870299">(Oct 20 2020 at 02:48)</a>:</h4>
<p>That doesn't seem to work. Interestingly after setting <code>debug-logging=true</code> all of the tests in debuginfo are skipped:</p>
<div class="codehilite"><pre><span></span><code>rust  master $ RUSTC_LOG=debug ./x.py test src/test/debuginfo
Updating only changed submodules
Submodules updated in 0.02 seconds
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.08s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.12s
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.08s
Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 tool compiletest (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.08s
Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu)

running 116 tests
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 100/116
iiiiiiiiiiiiiii.
test result: ok. 1 passed; 0 failed; 115 ignored; 0 measured; 0 filtered out

        finished in 0.479
Build completed successfully in 0:00:01
</code></pre></div>


<p>Previously at least some of the tests would run.</p>



<a name="213870312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213870312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213870312">(Oct 20 2020 at 02:49)</a>:</h4>
<p>config.toml:</p>
<div class="codehilite"><pre><span></span><code>changelog-seen = 2

[llvm]

[build]

[install]

[rust]

debug-logging = true

[target.x86_64-unknown-linux-gnu]

[dist]
</code></pre></div>



<a name="213870382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213870382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213870382">(Oct 20 2020 at 02:50)</a>:</h4>
<p>that's weird :/ does it work with --stage 2?</p>



<a name="213870554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213870554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213870554">(Oct 20 2020 at 02:55)</a>:</h4>
<p>maybe it would help to run <code>rustc +stage1</code> on them individually instead of going through the test suite</p>



<a name="213870560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213870560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213870560">(Oct 20 2020 at 02:55)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#creating-a-rustup-toolchain">https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#creating-a-rustup-toolchain</a></p>



<a name="213880495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Enabling%20debug%20logs%20in%20compiletest%3F/near/213880495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Enabling.20debug.20logs.20in.20compiletest.3F.html#213880495">(Oct 20 2020 at 06:52)</a>:</h4>
<p>The part I want to debug is compiletest's debugger test lines so directly compiling with rustc won't help.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>